import os
from data import *


did = []
didnt = []
for user in ALL_DIR:
    commit_dir =  user+"/01commit"
    files = os.listdir(commit_dir)
    if files:
        did.append(user)
    else:
        didnt.append(user)
print("已交:")
print("-"*15)
for i in did:
    print(USER_INFO[i].get("name"))
print("-"*15)
print("未交:")
print("-"*15)
for i in didnt:
    print(USER_INFO[i].get("name"))

iftext = input("\n是否导出文本文件? y/n")
if iftext == "y":
    
    filename = input("请输入文件名")
    with open(f"{filename} 第4组 作业提交情况.txt",'w') as f:
        f.write("[未交]\n")
        for i in didnt:
            f.write("    "+USER_INFO[i].get("name")+"\n")
        f.write("[已交]\n")
        for i in did:
            f.write("    "+USER_INFO[i].get("name")+"\n")

